package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.pojo.market.ChargeCouponParam;
import com.zhentao.model.pojo.market.dto.ChargeUserCouponDto;
import com.zhentao.service.ChargeUserCouponService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/market/api")
public class MarketUserController {


    @Resource
    private ChargeUserCouponService chargeUserCouponService;


    /**
     * @description: 查询用户自身优惠券列表
     * @param dto
     * @return ResponseResult
     */
    @PostMapping("/user/coupon/page")
    public ResponseResult userCouponList(@RequestBody ChargeUserCouponDto dto){
        return chargeUserCouponService.userCouponList(dto);
    }

    /**
     * @description  获取每个登录用户的优惠卷个数
     * @author 振涛教育_小Q
     * @date    2024/12/22 21:35
      * @param
     * @return com.zhentao.model.common.dtos.ResponseResult
     */
    @GetMapping("/user/coupon/count")
    public ResponseResult UserCouponCount(){
        return chargeUserCouponService.UserCouponCount();
    }

    @PostMapping("/user/coupon/ids/coupon/amount")
    public ResponseResult getCouponAmount(@RequestBody ChargeUserCouponDto dto){
        return chargeUserCouponService.getCouponAmount(dto);
    }

}
